package com.flying.admin.service;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.data.Data;
import com.flying.framework.service.AbstractService;

@Service(value="ServiceInterfaceGroup", desc="系统接口分组")
public class ServiceInterfaceGroup extends AbstractService{
	public final static String TABLE_NAME = "sys_service_interface_group";
	
	public enum Field {
		
		group_id       ("group_id",          "int",	"分组ID"),
		name           ("name",              "String",	"分组名称"),
		remark         ("remark",            "String",	"分组说明"),
		parent_id      ("parent_id",         "int",	"上级分组ID");
		
		public final String fieldName;
		public final String fieldType;
		public final String fieldComment;
	
		Field(String name, String dataType, String comment) {
			this.fieldName 		= name;
			this.fieldType		= dataType;
			this.fieldComment	= comment;
		}
	}
        
	@MethodInfo("创建系统接口分组")
	@DaoCreate(entity="sys_service_interface_group")
	public Data create(
		
			@Param(value="group_id",          required=true,	desc="分组ID") int group_id,
			@Param(value="name",              required=false,	desc="分组名称") String name,
			@Param(value="remark",            required=false,	desc="分组说明") String remark,
			@Param(value="parent_id",         required=false,	desc="上级分组ID") int parent_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("修改系统接口分组")
	@DaoUpdate(entity="sys_service_interface_group")
	public Data update(
		
			@Param(value="group_id",          required=false,	desc="分组ID") int group_id,
			@Param(value="name",              required=false,	desc="分组名称") String name,
			@Param(value="remark",            required=false,	desc="分组说明") String remark,
			@Param(value="parent_id",         required=false,	desc="上级分组ID") int parent_id,
			@Param(value="fields", required=false, desc="更新字段", tag="fields") String[] fields
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除系统接口分组")
	@DaoRemove(entity="sys_service_interface_group")
	public Data remove(
		
			@Param(value="group_id",          required=true,	desc="分组ID") int group_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("查询所有系统接口分组")
	@DaoQuery(entity="sys_service_interface_group")
	public Data findAll() throws Exception {
		return null;
	}

	@MethodInfo("根据主键查询系统接口分组")
	@DaoQuery(entity="sys_service_interface_group", single=true)
	public Data findById(
		
			@Param(value="group_id",          required=true,	desc="分组ID") int group_id
		
		) throws Exception {
		return null;
	}

}